import express from 'express';
import GroupController from '../controller/groupCtrl.js';

const router = express.Router();

// 获取群组列表
router.get('/groups/page/:page', GroupController.getList);

// 获取群组详情
router.get('/groups/:id', GroupController.getById);

// 创建群组
router.post('/groups', GroupController.create);

// 更新群组
router.put('/groups/:id', GroupController.update);

// 删除群组
router.delete('/groups/:id', GroupController.delete);

// 加入群组
router.post('/groups/:id/join', GroupController.join);

// 退出群组
router.post('/groups/:id/leave', GroupController.leaveGroup);

export default router; 